var api = 'http://192.168.10.164';
(function (doc, win) {

    function modifileRootRem() {
        var root = window.document.documentElement;
        var fontSize = parseFloat(root.style.fontSize);
        var finalFontSize = parseFloat(window.getComputedStyle(root).getPropertyValue("font-size"));
        if (finalFontSize === fontSize) return;
        root.style.fontSize = fontSize * (fontSize / finalFontSize) + "px";
    }

    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function () {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            docEl.style.fontSize = 100 * (clientWidth / 720) + 'px';
            modifileRootRem();
        };

    // Abort if browser does not support addEventListener
    recalc();
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);

})(document, window);
/*
    获取浏览器的传参 直接调用变量接收即可
*/
// $(function(){
function GetRequest() {
    var url = location.search;
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}
// 图片裁剪完毕后 得到的是base64 后台需要file 调用这个方法可以将base64转file 
function dataURLtoFile(dataurl, filename) {//将base64转换为文件
    var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
        bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
    while (n--) {
        u8arr[n] = bstr.charCodeAt(n);
    }
    return new File([u8arr], filename, { type: mime });
}

$(".nav_title_leftimg").click(function () {
    history.back(-1)
})

// })
